import tkinter as tk

import DateUtils


def button_click():
    label.config(text="Button clicked!")

def update_label():
    label.config(text=DateUtils.getDate())
    window.after(1000, update_label)  # 每隔1秒更新一次标签

if __name__ == '__main__':
    window = tk.Tk()
    labelTip = tk.Label(window,text="欢迎使用爬虫系统")
    label = tk.Label(window, text="Hello, Tkinter!")
    labelTip.pack()
    label.pack()
    button = tk.Button(window, text="Click me!", command=button_click)
    button.pack()
    window.after(1000, update_label)  # 启动定时更新标签的任务
    window.mainloop()